1 Data

## [1] "Earliest Price Date :  2023-08-16"
## [1] "Latest Price Date :  2024-06-24"
## [1] "Market Price used :  2024-06-24"
##   Ticker Close   DateTime         Trend    SO     SOSignal  Ch1D YestCh  Ch5D
## 1   BFIN   885 2024-06-24     Downtrend 75.22 Warning Sell -2.21   2.26  0.57
## 2   IMPC   350 2024-06-24     Downtrend 30.99 Warning Sell  0.00   1.16 -5.41
## 3   BMRI  6000 2024-06-24       Uptrend 71.21     Sell Now -2.04   2.94  2.13
## 4   ICBP 10300 2024-06-24     Downtrend 40.92 Warning Sell  0.00   1.23 -3.51
## 5   MPMX   955 2024-06-24     Downtrend 71.52 Warning Sell  1.06   1.07  0.53
## 6   ADMR  1320 2024-06-24 New Downtrend 30.00     Sell Now -2.22  -0.37  0.38
##    Ch20D  Ch60D YTDRet        Volume ChTurnover ChTurnover5D AvgCondition
## 1 -16.51 -31.92 -16.11           ---      -0.64        -0.79       Low TO
## 2  -5.41 -10.26   9.38           ---      -0.14        -0.71       Low TO
## 3  -0.41 -15.79  20.89           ---      -0.69        -0.63       Low TO
## 4  -0.96  -4.41   3.00           ---      -0.80        -0.61      High TO
## 5  -8.61  -8.61 -14.73           ---      -0.64        -0.61       Low TO
## 6  -1.49  -9.28 -22.12 Above Average      -0.26        -0.52       Low TO
##   KairiMABB20 KairiMABB60 KairiMABB200       RelativeTrendStart
## 1       -7.54      -16.67       -20.74                      ---
## 2        0.36       -0.44        -0.45                      ---
## 3        1.14       -4.56        -1.73 Relative Downtrend Start
## 4        0.18        0.78        -2.64                      ---
## 5       -4.07       -2.98        -4.26                      ---
## 6       -2.62        1.20         1.92                      ---
##        RelativeTrend       RelativeMomentum      EnteringQuadrant
## 1 Relative Downtrend Relative Down Momentum                   ---
## 2 Relative Downtrend   Relative Up Momentum                   ---
## 3 Relative Downtrend   Relative Up Momentum Enter Sprint Quadrant
## 4 Relative Downtrend   Relative Up Momentum                   ---
## 5 Relative Downtrend Relative Down Momentum                   ---
## 6   Relative Uptrend Relative Down Momentum                   ---
##          Quadrant    BB Bandwidth BandwidthDirection F1D    F2D    F1Wk
## 1  Loser Quadrant 23.18     32.15               0.40   0   3.50   39.54
## 2 Sprint Quadrant 42.77      9.03              -1.63   0   0.15   -0.28
## 3 Sprint Quadrant 50.99     10.50              -0.45   0 113.72 -197.94
## 4 Sprint Quadrant 39.73      8.20               0.04   0 -33.37  -20.92
## 5  Loser Quadrant 26.69     22.05               0.78   0   3.02    4.85
## 6   Rest Quadrant 27.74     16.48               0.08   0   9.25   12.25
##       F1Mo Weekly_Trend WkESOValue     WkESO Monthly_Trend MoESOValue     MoESO
## 1   128.24    Downtrend       1.15   Buy Now     Downtrend      43.28 Alert Buy
## 2    -5.32    Downtrend      46.97 Alert Buy   New Uptrend      31.05 Still Buy
## 3 -2063.60    Downtrend      35.56   Buy Now       Uptrend      73.93 Alert Buy
## 4    28.23    Downtrend      63.12 Alert Buy     Downtrend      67.25 Still Buy
## 5    33.62    Downtrend       8.44   Buy Now     Downtrend      45.71   Buy Now
## 6    65.02    Downtrend      10.61   Buy Now       Uptrend      32.82   Buy Now
##   PriceVolumeCond Last1D_PVCond Last2D_PVCond Corr20D Corr60D Corr5D
## 1       Fake Fall     Real Rise     Real Rise    0.91    0.86   0.88
## 2             ---     Fake Rise     Fake Rise   -0.07    0.72  -0.12
## 3       Fake Fall     Real Rise     Real Rise    0.09    0.75   0.95
## 4             ---     Real Rise     Real Rise    0.04    0.51  -0.20
## 5       Fake Rise     Real Rise     Real Rise    0.84    0.69   0.78
## 6       Fake Fall     Real Fall     Real Fall    0.63   -0.11   0.22
##   Corr5D_Direction Corr20D_Direction Corr60D_Direction     MA5     MA20
## 1            -0.01              0.00             -0.04   866.0   968.50
## 2            -0.14              0.00             -0.31   349.6   352.30
## 3            -0.01              0.00              0.01  5915.0  5993.75
## 4             0.01              0.00             -0.27 10295.0 10387.50
## 5             0.00              0.01              0.10   938.0  1006.75
## 6             0.08             -0.04             -0.14  1335.0  1370.25
##       MA60    MA200  Price_vs_MA200 KairiMA20 KairiMA60 KairiMA200
## 1  1102.17  1149.22     Below MA200     -9.44    -24.54     -29.86
## 2   364.10   361.75     Below MA200     -0.66     -4.03      -3.36
## 3  6515.42  6283.75     Below MA200      0.10     -8.59      -4.73
## 4 10582.92 10874.38     Below MA200     -0.85     -2.75      -5.58
## 5  1019.42  1025.50     Below MA200     -5.42     -6.75      -7.38
## 6  1349.92  1332.43 Breakdown MA200     -3.81     -2.27      -0.94
##   MA20Direction MA60Direction MA200Direction MarketCap Turnover AvgMOTurnover
## 1         -8.75         -6.92          -1.90  14130.90     3.62         18.22
## 2         -1.00         -0.67           0.00   1691.73     1.06          2.03
## 3         -1.25        -18.75           1.00 277200.00   355.93        802.83
## 4         -5.00         -7.92          -5.88 120117.66    17.66         53.12
## 5         -4.50         -1.50          -0.35   4262.13     2.18         12.11
## 6         -1.00         -2.25           0.83  53964.68    21.69         35.43
##   TurnoverRatio AvgMOTurnoverRatio                  IDXSector
## 1          0.03                 NA                   Keuangan
## 2          0.06               0.12              Perindustrian
## 3          0.13               0.29                   Keuangan
## 4          0.01               0.04     Barang Konsumen Primer
## 5          0.05               0.27 Barang Konsumen Non-Primer
## 6          0.04               0.06                     Energi
##                      IDXIndustry             Candle_Daily
## 1            Pembiayaan Konsumen Marubozu - Closing Black
## 2 Produk & Perlengkapan Bangunan Marubozu - Closing White
## 3                           Bank Marubozu - Closing Black
## 4                 Makanan Olahan                   Hammer
## 5                 Ritel Otomotif     White Candle - Small
## 6             Produksi Batu Bara         Marubozu - Black
##              Candle_Weekly           Candle_Monthly Support_1 Support_2
## 1 Marubozu - Closing Black             Black Candle    960.00    905.00
## 2 Marubozu - Closing White        Hammer - Inverted    326.67    309.33
## 3 Marubozu - Closing Black             Black Candle   5350.00   4800.00
## 4                   Hammer Marubozu - Opening White   9283.33   8816.67
## 5          Three Inside Up      Black Candle - Long   1016.67    973.33
## 6         Marubozu - Black      Black Candle - Long   1323.33   1196.67
##   Support_3 Resistance_1 Resistance_2 Resistance_3 Wk_Support_1 Wk_Support_2
## 1    825.00      1095.00      1175.00      1230.00       960.00       905.00
## 2    282.67       370.67       397.33       414.67       326.67       309.33
## 3   4075.00      6625.00      7350.00      7900.00      5350.00      4800.00
## 4   7883.33     10683.33     11616.67     12083.33      9283.33      8816.67
## 5    941.67      1091.67      1123.33      1166.67      1016.67       973.33
## 6   1103.33      1543.33      1636.67      1763.33      1323.33      1196.67
##   Wk_Support_3 Wk_Resistance_1 Wk_Resistance_2 Wk_Resistance_3
## 1       825.00         1095.00         1175.00         1230.00
## 2       282.67          370.67          397.33          414.67
## 3      4075.00         6625.00         7350.00         7900.00
## 4      7883.33        10683.33        11616.67        12083.33
## 5       941.67         1091.67         1123.33         1166.67
## 6      1103.33         1543.33         1636.67         1763.33

2 Exploratory Data

Before we analyze stocks prices, we explore all the stocks prices as a whole.

2.1 Stocks and Market Cap

2.2 Circular Barplot

2.3 Circle

2.4 Multiple Technical Data

Tabel ini menampilkan data agregat indikator Analisis Teknikal pada saham - saham pilihan.

2.5 IDX Sector Return

Tabel ini menampilkan Multiple Return tiap Sektor.

2.6 IDX Industry Return

Tabel ini menampilkan Multiple Return tiap Industri.

2.7 Stoch. Osc. Summary - IDX Sector

Tabel ini menampilkan data Stochastic Oscillator (%K) berbagai Timeframe untuk tiap Sektor.

2.8 Daily Stoch. Osc Summary - IDX Industry

2.9 Weekly Stoch. Osc Summary - IDX Industry

2.10 Monthly Stoch. Osc Summary - IDX Industry

2.11 BB Summary - IDX Sector

Tabel ini menampilkan Multiple Return tiap IDX Sektor.

2.12 BB Summary - IDX Industry

Tabel ini menampilkan Multiple Return IDX Industry tiap IDX Sektor.

2.12.1 Table Explanatory Data

IDXIndustry_avgBB <- quantech %>%
  group_by(IDXIndustry) %>%
  summarize(IDXIndustry_avgBB = mean(BB))

IDXSector_avgBB <- quantech %>%
  group_by(IDXSector) %>%
  summarize(IDXSector_avgBB = mean(BB))

IDXSector_avgSOd <- quantech %>% 
  group_by(IDXSector) %>% 
  summarize(IDXSector_avgSOd = mean(SO))

IDXIndustry_avgSOd <- quantech %>% 
  group_by(IDXIndustry) %>% 
  summarize(IDXIndustry_avgSOd = mean(SO))

quantech <- left_join(quantech, IDXIndustry_avgBB) %>% 
  left_join(., IDXSector_avgBB) %>% 
  left_join(., IDXSector_avgSOd) %>% 
  left_join(., IDXIndustry_avgSOd)
## Joining with `by = join_by(IDXIndustry)`
## Joining with `by = join_by(IDXSector)`
## Joining with `by = join_by(IDXSector)`
## Joining with `by = join_by(IDXIndustry)`

3 Table

3.1 All Table

3.2 Positive 20D Return

Tabel ini menampilkan saham dengan Return 20 hari terakhir yang positif.

3.3 Above MA200

Tabel ini menampilkan saham dengan harga di atas MA200.

3.4 Outperform Trend

Tabel ini menampilkan Saham dalam Outperform Trend yang berarti cenderung bergerak lebih baik dari IHSG.

3.5 Outperform Trend Signal

Tabel ini menampilkan Saham yang baru saja memasuki Outperform Trend.

3.6 Outperform Quandrant

Tabel ini menampilkan Saham di dalam Outperform Quandrant yang berarti cenderung bergerak lebih baik dari IHSG.

3.7 AlertBuyNow

Tabel ini menampilkan Saham yang mendapat sinyal Buy baik Alert Buy maupun Buy Now (Golden Cross dari Stochastic Oscillator).

3.8 AlertBuyNow and Uptrend

Tabel ini menampilkan Saham yang mendapat sinyal Buy (Alert Buy dan Buy Now) dan dalam Uptrend (di atas MA20).

3.9 Weekly Net Foreign Buy

Tabel ini menampilkan Saham dengan Net Buy Asing dalam 5 hari terakhir.

3.10 Rally with Trading Value

Tabel ini menampilkan Saham yang Rally (harganya naik dan diikuti kenaikan Trading Value).

3.11 High Turnover

Tabel ini menampilkan Saham dengan Turnover (lebih) Tinggi (dari sebelumnya).

3.12 High Turnover+Buy

Tabel ini menampilkan Saham dengan Turnover Tinggi dengan sinyal Buy (Alert Buy dan Buy Now).

3.13 Undershoot

Tabel ini menampilkan Saham yang Undershoot (dibawah Below Bollinger Band).

3.14 Fake Fall

Tabel ini menampilkan Saham yang harganya turun dan diikuti penurunan Trading Value.

3.15 Squat Bars

Tabel ini menampilkan Squat Bar (kenaikan harga tidak setinggi kenaikan Trading Value).

3.16 All Returns

Tabel ini menampilkan saham dengan semua Return yang tersedia (1D, 5D, 20D dan YTD).

3.17 Chart Strategies Return

Tabel ini menampilkan saham Chart Strategy dengan semua Return yang tersedia (1D, 5D, 20D dan YTD).

4 Graphic Stocks

4.1 All Stocks

4.2 Stock with AlertBuyNow

Grafik ini menampilkan Saham yang mendapat sinyal Buy baik Alert Buy maupun Buy Now (Golden Cross dari Stochastic Oscillator).

4.3 Stock with AlertBuyNow and Uptrend

Tabel ini menampilkan Saham yang mendapat sinyal Buy (Alert Buy dan Buy Now) dan dalam Uptrend (di atas MA20).

4.4 Stock that Rally with Trading Value

Tabel ini menampilkan Saham yang Rally (harganya naik dan diikuti kenaikan Trading Value).

4.5 Stocks with Positive 20D Return - O/P Trend

Grafik ini menampilkan Saham dan Trend-nya yang mencatat Positive 20D Return, dipisahkan berdasarkan Outperform Trend.

4.6 Stocks with Positive 20D Return - IDX Sector

Grafik ini menampilkan Saham dan IDX Sector-nya yang mencatat Positive 20D Return - dipisahkan berdasarkan IDX Sector

4.7 Stocks with Positive 20D Return - IDX Sector (alternative)

Grafik ini menampilkan Saham dan IDX Sector-nya yang mencatat Positive 20D Return - dipisahkan berdasarkan IDX Sector

4.8 Stocks with Positive 1D, 5D and 20D Return

Grafik ini menampilkan Saham dan Relation-nya yang mencatat Positive 20D, 5D dan 1D Return.

4.9 Stocks with Net Buy Asing 20D and 5D

Grafik ini menampilkan Saham dan Trend-nya yang mencatat Net Buy Asing dalam 5 dan 20 hari terakhir.

4.10 Stocks with Net Buy Asing 20D and 5D (IDX Sector)

Grafik ini menampilkan Saham dan Trend-nya yang mencatat Net Buy Asing dalam 5 dan 20 hari terakhir.

4.11 Stocks with High Turnover

4.12 Stocks with High Turnover (IDX Sector)

4.13 Stocks with High Turnover and Buy Signs

4.14 Stocks with Trend and Momentum

4.15 Stocks with Trend and Momentum (Best Area only)

5 Graphic IDXSectors

5.1 IDXSector in Trend and Momentum

Grafik ini menampilkan Sektor dan Relasinya-nya dengan Trend dan Stoch. Oscillator.

5.2 IDXIndustry in Trend and Momentum

Grafik ini menampilkan Sektor dan Relasinya-nya dengan Trend dan Stoch. Oscillator.

5.3 IDXSector in Foreign Net Buy 5D Positive

Grafik ini menampilkan Sektor dan Relasinya-nya dengan Net Buy Asing yang positif dalam 5 hari.

5.4 IDXIndustry in Foreign Net Buy 5D Positive

Grafik ini menampilkan Sektor dan Relasinya-nya dengan Net Buy Asing yang positif dalam 5 hari.

5.5 IDXSector in 1D, 5D and 20D % Change

Grafik ini menampilkan Sektor dan Relasinya-nya dengan Rata - Rata Pergerakannya dalam 1D, 5D dan 20D.

5.6 IDXIndustry in 1D, 5D and 20D % Change

Grafik ini menampilkan Sektor dan Relasinya-nya dengan Rata - Rata Pergerakannya dalam 1D, 5D dan 20D.

6 Graphic IDX Stock Explorer Rotation

6.1 Stock Explorer Quadrant

Grafik Stock Explorer Quadrant ini menampilkan Saham dan Trend-nya dengan sinyal.

6.2 Stock Explorer Quadrant (O/P Trend Only)

Grafik Stock Explorer Quadrant ini hanya menampilkan Saham (berserta Trend) yang berada pada kuadran Outperform.

6.3 Stock Explorer Quadrant (O/P Trend Only) with Uptrend

Grafik Stock Explorer Quadrant ini hanya menampilkan Saham (berserta Trend) yang berada pada kuadran Outperform.

6.4 Stock Explorer Quadrant (O/P Trend Only) with Buy Signal and Uptrend

Grafik Stock Explorer Quadrant ini hanya menampilkan Saham (berserta Trend) yang berada pada kuadran Outperform.

6.5 Stock Explorer Quadrant (O/P Quadrant Only)

Grafik Stock Explorer Quadrant ini hanya menampilkan Saham (berserta Trend) yang berada pada kuadran Outperform.

6.6 Stock Explorer Quadrant (O/P Quadrant Only) with Uptrend

Grafik Stock Explorer Quadrant ini hanya menampilkan Saham (berserta Trend) yang berada pada kuadran Outperform.

6.7 Stock Explorer Quadrant (O/P Quadrant Only) with Buy Signal and Uptrend

Grafik Stock Explorer Rotation ini hanya menampilkan Saham yang mendapat sinyal Buy (Alert Buy dan Buy Now), dalam kondisi Uptrend dan berada pada kuadran Outperform.

7 Trading Modules

7.1 Low Correlation

7.2 High Correlation

7.3 Squeezing to Blow

7.4 Buy on Weakness in Uptrend

7.5 New Uptrend

7.6 No Weekly and Monthly Overbought

8 Cluster

8.1 1D, 5D, 20D & YTD Return

Table dan Grafik ini menggolongkan saham pada return 1, 5, 20 hari dan YTD (dari sejak awal tahun 2020).

##    Ticker  D1Ch  D5Ch  D20Ch  YTDCh
## 1    ACES  0.00  1.20   5.62  70.36
## 2    ADHI  2.04  1.01 -11.50 -58.68
## 3    ADMR -2.22  0.38  -1.49 -22.12
## 4    ADRO -0.37 -2.16  -5.56 -29.35
## 5    AKRA  3.16  2.52   3.82  16.43
## 6    AMRT  1.48  0.74  -0.72   3.40
## 7    ANTM  1.63 -0.40 -20.13 -37.03
## 8    ARTO  6.19  4.21  -5.11 -40.05
## 9    ASII -1.34 -0.67  -5.74 -22.28
## 10   ASLC  0.00 -8.75 -21.51 -39.67
## 11   ASSA -0.74 -5.59 -15.63 -12.90
## 12   AUTO -0.82 -1.89  -8.08  24.66
## 13   AVIA -2.88 -5.61   1.00 -19.84
## 14   BBCA  0.00  4.35   2.40  12.28
## 15   BBNI  0.00  1.34  -4.82  -1.58
## 16   BBRI -0.90  2.09  -5.98 -10.93
## 17   BBTN -0.80  0.00   0.00  -8.15
## 18   BFIN -2.21  0.57 -16.51 -16.11
## 19   BIRD -0.33 -0.65  -0.65   8.51
## 20   BJTM  0.00  1.96  -8.77 -26.76
## 21   BMRI -2.04  2.13  -0.41  20.89
## 22   BSDE -2.04  1.05   1.05   4.35
## 23   BTPS  4.15  4.15  -6.61 -59.50
## 24   CLEO -0.79 -3.85   5.04 125.23
## 25   CPIN  6.69  0.00  -1.45  -9.73
## 26   CTRA -2.67 -2.23  -3.52  16.49
## 27   DMAS -1.27  1.97  -5.49  -2.52
## 28   DRMA  1.73  3.53  -3.30  50.43
## 29   ELSA  0.46  7.43  -1.81  39.10
## 30   ERAA -1.02 -3.48  -3.96  -1.02
## 31   EXCL -0.92  0.00 -12.55   0.93
## 32   HRTA -0.56  1.15 -10.66  74.26
## 33   HRUM -0.88  0.45 -17.95 -30.86
## 34   ICBP  0.00 -3.51  -0.96   3.00
## 35   IMPC  0.00 -5.41  -5.41   9.38
## 36   INCO -3.32 -0.73 -19.21 -42.54
## 37   INDF -0.84 -3.27  -3.66 -11.90
## 38   INKP -0.28  0.29  -8.83   0.57
## 39   INTP -1.68 -1.01   4.64 -26.01
## 40   IPCC -0.76 -5.07  -4.38  14.91
## 41   ISAT  0.72  3.19   2.44  70.04
## 42   JPFA  0.69  9.40   2.46  12.36
## 43   JSMR  0.70  1.52   2.55  68.62
## 44   KLBF -1.27 -0.96   2.99 -25.84
## 45   MAIN  4.00  5.69   8.33  32.65
## 46   MAPA -2.05 -5.92 -11.73  85.71
## 47   MAPI -1.05 -3.74   0.71  -2.08
## 48   MEDC  1.56  2.77  -7.47  28.08
## 49   MIDI  0.00  3.06   6.32  43.26
## 50   MIKA -0.67  0.00  -4.84  -7.52
## 51   MPMX  1.06  0.53  -8.61 -14.73
## 52   MTEL  0.78  3.20   7.50 -19.38
## 53   MYOR  0.42  0.84   3.91  -4.40
## 54   POWR  0.81  0.00  -7.46  -6.06
## 55   PTPP -0.67 -9.15 -18.58 -58.32
## 56   PWON -1.04 -5.94  -3.55 -16.67
## 57   SCMA  1.38  8.89   5.00 -28.64
## 58   SIDO  1.35  0.67   8.70  -0.66
## 59   SMGR -0.27  0.82  -7.52 -43.88
## 60   TAPG -0.88  0.00   3.70 -11.81
## 61   TLKM  0.00  3.87   0.00 -21.33
## 62   TOWR -3.57 -2.17  -9.40 -38.64
## 63   ULTJ -1.07  2.78  -1.60  25.42
## 64   UNTR  0.46 -1.36  -3.12 -16.68

8.1.1 Graph YTD - 5D

8.1.2 Graph 20D - 5D

8.1.3 Graph 1D - 5D

8.1.4 Table

8.2 Daily, Weekly and Monthly Stoch. Osc

Table dan Grafik ini menggolongkan saham berdasarkan Daily dan Weekly Stochastic Oscillator.

8.2.1 Graph

8.2.2 Table

8.3 20D & 60D Correlation

Table dan Grafik ini menggolongkan saham berdasarkan Korelasi terhadap IHSG dalam 20 dan 60 hari terakhir.

8.3.1 Graph

8.3.2 Table

8.4 IDXSector Return Cluster

8.4.1 Graph

8.4.2 Table

8.5 IDXIndustry Return Cluster

8.5.1 Graph

8.5.2 Table

8.6 Foreign Flow

8.6.1 Graph

8.6.2 Table

8.7 KairiMABB

8.7.1 Graph

8.7.2 Table

8.8 Kairi MA5, MA20, MA60 and MA200

8.8.1 Graph

8.8.2 Table

9 Custom Index

9.1 Creating Index

range(quantech_full$DateTime)
## [1] "2023-08-16" "2024-06-24"
bank_index <- quantech_full %>% 
  select(DateTime, Ticker, Close) %>%
  filter(Ticker %in% c("BMRI", "BBNI", "BBCA", "BBRI")) %>% 
  group_by(DateTime) %>%
  summarise(bank_index = sum(Close)/n())

# prajogo_index <- quantech_full %>% 
#   select(DateTime, Ticker, Close) %>%
#   filter(Ticker %in% c("BREN", "TPIA", "BRPT")) %>% 
#   group_by(DateTime) %>%
#   summarise(prajogo_index = sum(Close)/n())

fmcg_index <- quantech_full %>% 
  select(DateTime, Ticker, Close) %>%
  filter(Ticker %in% c("INDF", "ICBP", "MYOR", "SIDO")) %>% 
  group_by(DateTime) %>%
  summarise(fmcg_index = sum(Close)/n())

telecom_index <- quantech_full %>% 
  select(DateTime, Ticker, Close) %>%
  filter(Ticker %in% c("EXCL", "TLKM", "ISAT")) %>% 
  group_by(DateTime) %>%
  summarise(telecom_index = sum(Close)/n())

property_index <- quantech_full %>% 
  select(DateTime, Ticker, Close) %>%
  filter(Ticker %in% c("BSDE", "CTRA", "PWON")) %>% 
  group_by(DateTime) %>%
  summarise(property_index = sum(Close)/n())

9.1.1 Chart

fmcg_index %>% 
  ggplot(aes(x = DateTime, y = fmcg_index))+
  geom_line()+
  geom_ma(ma_fun = SMA, n = 20) +
  # geom_bbands(ma_fun = SMA, sd = 2, n = 20)+
    labs(title = "FANG Candlestick Chart", 
         subtitle = "Experimenting with Multiple Stocks",
         y = "Closing Price", x = "") + 
    theme_tq()
## Warning: Using the `size` aesthetic in this geom was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` in the `default_aes` field and elsewhere instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

9.1.2 Multiple Charts

quantech_full %>% 
  filter(IDXSector == "Barang Baku", Trend %in% c("New Uptrend", "Uptrend")) %>% 
  ggplot(aes(x = DateTime, y = Close))+
  geom_line()+
  geom_ma(ma_fun = SMA, n = 20) +
  # geom_bbands(ma_fun = SMA, sd = 2, n = 20)+
    labs(title = "FANG Candlestick Chart", 
         subtitle = "Experimenting with Multiple Stocks",
         y = "Closing Price", x = "") + 
  facet_wrap(~ Ticker, ncol = 2, scales = "free_y")+
    theme_tq()

9.1.3 Return Chart

left_join(bank_index, telecom_index) %>%
  left_join(., fmcg_index) %>%
  pivot_longer(cols = !DateTime) %>% 
  group_by(name) %>%
  filter(DateTime > "2023-12-31") %>% 
  tq_mutate(select = value, mutate_fun = periodReturn, period = "daily", type = "arithmetic") %>%
  mutate(wealth.index = 100 * cumprod(1 + daily.returns)) %>%
  ggplot(aes(x = DateTime, y = wealth.index, color = name)) +
  geom_line(linewidth = 1) +
  labs(title = "MA and V: Stock Prices") +
  theme_tq() + 
  scale_color_tq()
## Joining with `by = join_by(DateTime)`
## Joining with `by = join_by(DateTime)`

9.1.4 Monthly Graph Return

quantech_full %>% 
  filter(Ticker %in% c("BMRI", "BBCA", "BBRI", "BBNI"), DateTime > "2023-12-31") %>% 
  # filter_by_time(.date_var = DateTime, .start_date = "2024") %>% 
  group_by(Ticker) %>% 
  tq_transmute(select = Close, mutate_fun = periodReturn, period = "monthly", type = "arithmetic") %>%
    ggplot(aes(x = DateTime, y = monthly.returns, fill = Ticker)) +
    geom_col() +
    geom_hline(yintercept = 0, color = palette_light()[[1]]) +
    scale_y_continuous(labels = scales::percent) +
    labs(title = "Monthly Returns",
         # subtitle = "Get annual returns quickly with tq_transmute!",
         y = "Annual Returns", x = "") +
    facet_wrap(~ Ticker, ncol = 2, scales = "free_y") +
    theme_tq() + 
    scale_fill_tq()

10 Performance

periodReturn(bank_index %>% as.data.frame(), period = "monthly", subset = "2024")
##            monthly.returns
## 2024-01-31     0.041431262
## 2024-02-29     0.048824593
## 2024-03-28     0.009482759
## 2024-04-30    -0.081468830
## 2024-05-31    -0.111565638
## 2024-06-24     0.027208037
charts.PerformanceSummary(R = periodReturn(bank_index %>% as.data.frame(), period = "monthly", subset = "2024"))